package com.enumTest;

/**
 * <p>Description: [用法六：使用接口组织枚举]</p>
 * Created on 2021/1/8
 *
 * @author <a href="mailto: 819712047@qq.com">谢振东 </a>
 * @version 1.0
 */
public class test6 {
    public static void main(String[] args) {
        for (Food.Coffee c : Food.Coffee.values()) {
            printFood(c);
        }
        for (Food.Dessert d : Food.Dessert.values()) {
            printFood(d);
        }
    }

    private static void printFood(Food food) {
        System.out.println(food);
    }
}

interface Food {
    enum Coffee implements Food {
        BLACK_COFFEE, DECAF_COFFEE, LATTE, CAPPUCCINO
    }

    enum Dessert implements Food {
        FRUIT, CAKE, GELATO
    }
}
